#include <iostream>
#include <algorithm>
#include <map>
#include <sstream>
#include <vector>

using namespace std;

map<int, string> chinese {
  {0, "ling"}, {1, "yi"}, {2, "er"}, {3, "san"}, {4, "si"}, {5, "wu"},
  {6, "liu"}, {7, "qi"}, {8, "ba"}, {9, "jiu"}
}; 

string readnum(int n){
    string result;
    int q = n / 1000;
    if(n > 1000){
        result.append(chinese[q]);
    }
    if(n > 100){
        n = n % 1000;
        q = n / 100;

        if(n > 1000){
            result.append(" qian ");
        }
        result.append(chinese[q]);
    }
    if(n > 100){
        n = n % 100;
        q = n / 10;
        if(n > 10){
            result.append(" bai ");
        }
        result.append(chinese[q]);
    }
    n = n % 10;
    q = n / 1;
    if(n > 10){
        result.append(" shi ");
    }
    result.append(chinese[q]);
    return result;
}

vector<int> parseInt(int n){
    vector<int> result;

    while(n != 0){
        result.insert(result.begin(), n % 10);
        n = n / 10;
    }

    //reverse(result.begin(), result.end());

    return result;
}

int main(int argc, char const *argv[])
{
    cout << readnum(123) << endl;
    return 0;
}
